home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Thread Manager / ThreadUtilities / SnakesWithSemaphores / ThreadedSnakes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-17  |  1.6 KB  |  66 lines  |  [TEXT/MPS ]

  1. /*
  2.  *  ThreadedSnakes.h
  3.  *
  4.  *  Author:  Brad Post
  5.  *    Creation Date:    12/16/92
  6.  *  Copyright  © 1992, 1993  Apple Computer Inc.
  7.  *
  8.  *    This file contains all the header information to be used by the two files to do snakes.
  9.  *
  10.  */
  11.  
  12. #include <Dialogs.h>
  13. #include <Fonts.h>
  14. #include <QDOffscreen.h>
  15. #include <Errors.h>
  16. #include <Events.h>
  17. #include <Quickdraw.h>
  18. #include <Resources.h>
  19. #include <Windows.h>
  20. #include <Memory.h>
  21. #include <Menus.h>
  22. #include <stdlib.h>
  23. #include <Threads.h>
  24. #include <ToolUtils.h>
  25. #include <OSEvents.h>
  26. #include <Desk.h>
  27. #include <DiskInit.h>
  28. #include "ThreadUtil.h"
  29.  
  30. /*    1.01 - kTopLeft - This is for positioning the Disk Initialization dialogs. */
  31. #define kDITop                    0x0050
  32. #define kDILeft                    0x0070
  33.  
  34. #define MBarHeight    20            // needed to determine the size of the window
  35.  
  36. #define    aboutALRT    1001        // about box
  37. #define appleMenuID    1            
  38. #define fileMenuID    1001        // my file menu
  39. #define fileMenu    1
  40. #define fmQuit        1
  41. #define errorALRT    1002        // alert dialog
  42.  
  43. #define    notDONE        0            // not finished, so don't quit
  44. #define areDONE        1            // we're finished so we can quit away
  45.  
  46. typedef short    VEC[2];            // an X & Y coord, why didn't I just use Pt ... don't ask.... :-)
  47.  
  48. typedef struct {
  49.     VEC         pos;            // position
  50.     VEC         vel;            // velocity
  51.     int         length;            // length of snake
  52.     int         numOfMoves;        // number of moves
  53.     ThreadStyle    whatStyle;        // preemtive or cooperative
  54.     RGBColor    whatColor;        // what color to paint
  55. } SNAKE_ARGS;
  56.  
  57. extern VEC    theBounds;
  58. extern SNAKE_ARGS snake1;
  59. extern SNAKE_ARGS snake2, snake3, snake4, snake5;
  60.  
  61. /*
  62.  * Function prototypes go here.
  63.  */
  64. extern void    initSnakes();
  65. extern myError(Str255);
  66. extern void cleanUpSnakes();